import request from '/@/utils/request';

export const getUserByToken = (params: any) => {
    return request(
        {
            url: '/api/user/getInfoByToken',
            method: 'get',
           params,
        }
    )
};


// 用户管理
export const getUserListPage = (params: any) => {
    return request(
        {
            url: '/api/user/get',
            method: 'get',
           params,
        }
    )
};
export const removeUser = (params: any) => {
    return request(
        {
            url: '/api/user/delete',
            method: 'delete',
            params: params
        }
    )
};
export const editUser = (params: any) => {
    return request(
        {
            url: '/api/user/put',
            method: 'put',
            data: params
        }
    )
};
export const addUser = (params: any) => {
    return request(
        {
            url: '/api/user/post',
            method: 'post',
            data: params
        }
    )
};
export const batchRemoveUser = (params: any) => {
    //没做
    return request(
        {
            url: '/api/Claims/BatchDelete',
            method: 'delete',
            params: params
        }
    )
};


// 角色管理
export const getRoleListPage = (params: any) => {
    return request(
        {
            url: '/api/role/get',
            method: 'get',
           params,
        }
    )
};
export const removeRole = (params: any) => {
    return request(
        {
            url: '/api/role/delete',
            method: 'delete',
            params: params
        }
    )
};
export const editRole = (params: any) => {
    return request(
        {
            url: '/api/role/put',
            method: 'put',
            data: params
        }
    )
};
export const addRole = (params: any) => {
    return request(
        {
            url: '/api/role/post',
            method: 'post',
            data: params
        }
    )
};
